import os
import sys


class PathUtils(object):
    @staticmethod
    def app_path():
        """Returns the base application path."""
        if hasattr(sys, 'frozen'):
            # Handles PyInstaller
            return os.path.dirname(sys.executable).replace("\\", "/")  # 使用pyinstaller打包后的exe目录
        return os.path.dirname(__file__)[:-5].replace("\\", "/")  # 没打包前的py目录


path_utils = PathUtils()
